package com.qhyiyun.baseweb.util;

import io.micrometer.common.util.StringUtils;

public class CustomResponse<T> {
    private int status;
    private String message;
    private T data;

    // 构造方法
    public CustomResponse(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
    public static <T>CustomResponse success(String msg,T data){
        msg=StringUtils.isEmpty(msg)?"交易成功":msg;
        return new CustomResponse(200,msg,data);
    }
    // Getter和Setter方法
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}

